<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>for循环迭代</title>
    <script src="js/traceur.js"></script>
    <script src="js/bootstrap.js"></script>
    <script type="module">
        //用for迭代
        function* generator_function() {
            yield 1;
            yield 2;
            yield 3;
            yield 4;
            yield 5;
        }
        let arr = [1, 2, 3];
        for (let value of generator_function()) {
            console.log(value); // 1, 2, 3, 4, 5
        }
        for (let value of arr) {
            console.log(value); // 1, 2, 3
        }

    </script>
</head>
<body>

</body>
</html>